package com.dzl.goods.dao;

import com.dzl.base.mapper.BaseMapper;
import com.dzl.goods.pojo.WelfareGoodsAttr;
import com.dzl.goods.pojo.vo.WelfareSkuGoodsVo;
import com.dzl.goods.pojo.vo.WelfareGoodsAttrVoucherVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品sku规格表(WelfareGoodsAttr)表数据库访问层
 * @author ChenLong
 * @since 2021-05-18 17:58:33
 */
public interface WelfareGoodsAttrMapper extends BaseMapper<WelfareGoodsAttr> {

    /**
     * 获取该商品下未匹配到的规格id
     * @param list 规格id列表
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-01 20:39:40
     **/
    List<Integer> getGoodsAttrSkuListBySkuId(@Param("list") List<Integer> list, @Param("goodsId") Integer goodsId);

    /**
     * 逻辑删除为匹配到的规格id
     * @param list 规格id列表
     * @return int
     * @author ChenLong
     * @date 2021-06-01 20:39:44
     **/
    Integer deleteLogicGoodsAttrSkuListBySkuId(@Param("list") List<Integer> list);

    /**
     * 物理删除已有的规格id列表
     * @param list 规格id列表
     * @return int
     * @author ChenLong
     * @date 2021-06-01 20:39:47
     **/
    Integer deleteGoodsAttrSkuListBySkuId(@Param("list") List<Integer> list);

    /**
     * 添加sku列表
     * @param list 列表
     * @return int
     * @author ChenLong
     * @date 2021-06-17 20:16:38
     **/
    Integer insertGoodsAttrSkuList(@Param("list") List<WelfareGoodsAttr> list);

    /**
     * 获取规格和券密组名
     * @param goodsId 商品id
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-22 09:29:03
     **/
    List<WelfareGoodsAttrVoucherVo> getGoodsAttrWithVoucherByGoodsId(@Param("goodsId") Integer goodsId);

    /**
     * 获取规格详情
     * @param welfareGoodsAttr 规格id
     * @return java.util.List
     * @author ChenLong
     * @date 2021-06-22 18:51:57
     **/
    WelfareGoodsAttrVoucherVo getGoodsAttrWithVoucher(WelfareGoodsAttr welfareGoodsAttr);

    /**
     * 获取导出规格列表
     * @date 2021/7/29 0029 15:11
     * @author wangjian
     * @param ids 多id
     * @return java.util.List<com.dzl.goods.pojo.vo.WelfareGoodsAttrVo>
     */
    List<WelfareSkuGoodsVo> getGoodsAttrsByGoodsId(@Param("ids") String ids);
}

